<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <style>
    body {
      background: #000;
    }
    .container {
      width: 600px;
      height: 400px;
      margin: 10% auto;
      border-radius: 4px;
      position: relative;
      border: 2px solid white;
    }

    .photo {
      position: absolute;
      left: 0;
      top: 0;
      width: 100%;
      height: 100%;
      background-size: 600px 100%;
    }
    .bg_pic {
      background-image: url("./100.webp");
    }
    .toggle_pic {
      width:50%;
      background-image: url("./insight.ed906481.webp");
    }
    .progress {
      display: flex;
      justify-content: center;
      align-items: center;
      position: absolute;
      /* appearance: none; */
      width: 100%;
      height: 100%;
      background: rgba(255, 255, 255, 0.3);
      outline: none;
      margin: 0;
      transition: all 0.3s;
    }

    .progress:hover {
      background: rgba(243, 243, 243, 0.1);
    }

    .progress::-webkit-slider-thumb {
      /* appearance: none; */
      width: 5px;
      height: 400px;
      background-color: skyblue;
      cursor: pointer;
    }
  </style>
  <body>
    <div class="container">
      <div class="photo bg_pic"></div>
      <div class="photo toggle_pic"></div>
      <input
        type="range"
        min="1"
        max="100"
        value="50"
        class="progress"
        name="progress"
      />
    </div>
  </body>
  <script>
    let position;
    const progress = document.querySelector(".progress");
    progress.addEventListener('input',e => {
      position = e.target.value;
      let dom = document.querySelector('.toggle_pic')
      dom.style.width = `${position}%`
      
    })
  </script>
</html>
